<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Base\Annotation\Common;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
/**
 * @ODM\Document(repositoryClass="App\Repository\BannerRepository")
 * @ApiResource()
 */
class Banner
{
    /**
     * @Common(cnName="#",editType="text",listType="text")
     * @ODM\Id(strategy="INCREMENT")
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @Common(cnName="图片",editType="pic",listType="text")
     * @ODM\Field()
     * @ORM\Column(type="string", length=255)
     */
    private $pic;

    /**
     * @Common(cnName="顺序",editType="text",listType="text")
     * @ODM\Field(nullable=true)
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $sort = 999;

    /**
     * @Common(cnName="启用",editType="switch",listType="text")
     * @ODM\Field(type="boolean",nullable=true)
     * @ORM\Column(type="boolean")
     */
    private $enable = true;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getPic(): ?string
    {
        return $this->pic;
    }

    public function setPic(string $pic): self
    {
        $this->pic = $pic;

        return $this;
    }

    public function getSort(): ?string
    {
        return $this->sort;
    }

    public function setSort(?string $sort): self
    {
        $this->sort = $sort;

        return $this;
    }

    public function getEnable(): ?bool
    {
        return $this->enable;
    }

    public function setEnable(bool $enable): self
    {
        $this->enable = $enable;

        return $this;
    }
}
